package com.my.commonlib.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;

import com.my.commonlib.event.EventTypeLoginOrLoginOut;

import de.greenrobot.event.EventBus;


public class BaseFragment extends Fragment implements View.OnClickListener{

//    protected ActionBar mActionBar;

    public Activity mActivity;

    public Fragment mFragment;

//    public ApiProcess mApiProcess;
    public EventTypeLoginOrLoginOut eventTypeLoginOrLoginOut;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mFragment = this;
        mActivity = getActivity();
//        mApiProcess = new ApiProcess(getActivity());
//        mTask = new RequestTask(getActivity());
        EventBus.getDefault().register(this);
    }


    public void initActionBar(){
//        mActionBar = (ActionBar) getView().findViewById(R.id.mActionBar);
//        //处理actionbar的左右点击事件
//        mActionBar.getNavLeftLayout().setOnClickListener(this);
//        mActionBar.getNavRightLayout().setOnClickListener(this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }


    public void onEvent(EventTypeLoginOrLoginOut event){
        this.eventTypeLoginOrLoginOut = event;
    }

    @Override
    public void onClick(View v) {

    }
}
